﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ViewAllDeptsUserControl.ascx.cs"
    Inherits="JM.JCY.SharePointComponent.Department.ViewAllDepts.ViewAllDeptsUserControl" %>
<script type="text/javascript">

    function RedirectToDept(sender, deptId) {

        var URIScheme = "http://";
        var host = document.location.host;
        var url = URIScheme + host + "/MyDept/DepartmentPages/PublicDept.aspx?DeptId=" + deptId;
        sender.href = url;
    }

   
</script>
<div>
    <table class="main" width="100%">
        <tr>
            <td valign="top" width="100%" runat="server" id="tdContent">
                <table class="content" width="98%">
                    <tr>
                        <td colspan="2">
                            <h2>
                                <img src="/_layouts/JM.JCY.Resource/images/投票大.ico" width="32" />
                                所有部门列表</h2>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:GridView ID="gvAllDept" runat="server" AutoGenerateColumns="False" BorderWidth="0px"
                                GridLines="Horizontal" CssClass="altrowstablebc" Width="100%"
                                EnableModelValidation="True">
                                <Columns>
                                    <asp:TemplateField HeaderText="部门">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lbDeptName" runat="server" Text='<%#Eval("DeptName")%>' OnClientClick='<%# String.Format("RedirectToDept({0},{1})","this",Eval("ID")) %>'></asp:LinkButton>
                                        </ItemTemplate>
                                      
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
